import { http } from "@/utils/http";
import httpConfig from "@/utils/http/httpConfig";
const prefix = httpConfig.pms;

/**
 * 获取 品牌列表
 * @param params
 */
export function BrandList(params?: Record<string, any>) {
  return http.get(prefix + "/brand/list", { params });
}

/**
 * 添加 品牌
 * @param params
 * @returns {*}
 */
export function BrandAdd(params: Record<string, any>) {
  return http.post(prefix + "/brand", { data: params });
}

/**
 * 修改 品牌
 * @param params
 * @returns {*}
 */
export function BrandEdit(params: Record<string, any>) {
  return http.post(prefix + "/brand/edit", { data: params });
}

/**
 * 删除 品牌
 * @param params
 * @returns {*}
 */
export function BrandDelete(params: Record<string, any>) {
  return http.post(prefix + "/brand/del", { data: params });
}

/**
 * 获取详情 品牌
 * @param params
 * @returns {*}
 */
export function BrandDetail(params: any) {
  return http.get(prefix + "/brand/" + params);
}

/**
 * 获取分类下的品牌
 * @param params
 * @returns {*}
 */
export function getBrandsByCategoryId(cid: any) {
  return http.get(prefix + "/brand/getBrandsByCategoryId/" + cid);
}
